function abs(a){
    var result
    if (a<0){
        
        result = -a
    }else{
        
        result = a
    }
    return result
}

console.log(abs('字符串a的绝对值结果'));
console.log(abs('a'));

console.log(abs('-------------'));

console.log(abs('数字25的绝对值结果'));
console.log(abs(25));

console.log(abs('数字-25的绝对值结果'));
console.log(abs(-25));

console.log('---练习题圆---')

function area_of_circle(){
    var r=arguments[0]
    var pi=arguments[1]
    if (r === undefined){
        return 0
    }
    if (pi ===undefined){
        pi=3.14
    }
    return pi * r * r
}
console.log('圆面积');
console.log(area_of_circle(2,3.1415926));
console.log(area_of_circle(2));

console.log('---练习题两位数比大小---')

function max(a,b){
    var result
    if (a>b){
        result =a 
    }else{
        result =b
    }
    return result
}

console.log('50与60对比最大值为：')
console.log(max(50,60));

function max(a,b){
    var result
    if (a<b){
       result =a
    }else{
      result =b
    }
    return result
}

console.log('10与20对比最小值为：')
console.log(max(10,20));


